package com.yuke.cloud.service.pmc.controller.frontend;

import com.yuke.cloud.common.core.support.BaseController;
import com.yuke.cloud.common.util.wrapper.WrapMapper;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.pmc.entity.ProdSpecAttribute;
import com.yuke.cloud.service.pmc.service.ProdSpecAttributeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
* Created by zys on 2018/09/27.
*/
@Api(value = "WEB - ProdSpecAttributeController", tags = "处理ProdSpecAttribute相关请求", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RestController
@RequestMapping("/mall/prod/spec_attribute")
public class MallProdSpecAttributeController extends BaseController {
    @Resource
    private ProdSpecAttributeService prodSpecAttributeService;

    @GetMapping("/app/{specId}")
    @ApiOperation(httpMethod = "GET", value = "根据ID获取具体信息")
    public Wrapper<List<ProdSpecAttribute>> detail(@ApiParam(name = "specId", value = "记录id") @PathVariable Long specId) {
        return WrapMapper.ok(prodSpecAttributeService.getProdSpecAttrBySpecId(specId));
    }
}
